package com.cspm.common.core;

import com.cspm.common.util.DateUtil;
import org.springframework.core.convert.converter.Converter;

import java.text.ParseException;
import java.util.Date;

/**
 * Created by CHQIU on 2017-04-17.
 */
public class StringToDateConverter implements Converter<String, Date> {

    @Override
    public Date convert(String stringDate) {
        try {
            return DateUtil.stringToDate(stringDate, null);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }
}